import service from '@/utils/request'

export const getDepartmentListAPI = () => {
  return service.request({
    method: 'get',
    url: '/company/department'
  })
}

export const addDepartmentAPI = (data) => {
  return service.request({
    method: 'post',
    url: '/company/department',
    data
  })
}

export const editDepartmentAPI = (data) => {
  return service.request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}

export const delDepartmentAPI = (id) => {
  return service.delete(`/company/department/${id}`)
}

export const getDepartmentDetailAPI = (id) => {
  return service.request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

export const getDepartmentHeaderAPI = () => {
  return service.request({
    method: 'get',
    url: '/sys/user/simple'
  })
}
